<?php
//if ($this->session->flashdata('message')) { 
//    <p>=$this->session->flashdata('message')</p>
//}
if ( $_SESSION['logged_in'] == FALSE ) redirect (base_url ());    
echo '<div id="contentfull">';
echo '<div >';
?>
<!--<div><p> <h2> Credentials Check </h2></p> </div>-->
<?php echo validation_errors('<div class="error">', '</div>'); ?>

<?php $attributes = array('class' => 'frmedit', 'id' => 'edituser', 'width' => '400px', 'margin' => '0 auto');

   echo form_open('adduser', $attributes);
?>
 <?php echo form_fieldset('<h2> Create a new User  </h2>'); ?>
<table>
    <tr>
        <td width="40%" ><?php echo form_label('Name', 'Name'); echo form_error('Name');  ?> </td>
        <td width="60%" ><?php echo form_input('Name', set_value('Name')); ?>       </td>
    </tr>
    <tr>
        <td> <?php echo form_label('Email', 'username'); echo form_error('username'); ?> </td>
        <td> <?php echo form_input('username'); ?> </td>
    </tr>
    <tr>
        <td> <?php echo form_label('Mobile', 'mobile'); echo form_error('mobile'); ?> </td>
        <td> <?php echo form_input('mobile'); ?> </td>
    </tr>
    <tr>
        <td> <?php echo form_label('Security Level', 'level'); echo form_error('level'); $level = array('name' => 'level', 'id' => 'level',  'maxlength'   => '1',
              'size'        => '50',
              'style'       => 'width: 30px', ); ?> </td>
        <td> <?php echo form_input($level); ?> </td>
    </tr>
     <tr>
        <td> <?php echo form_label('Role', 'role'); echo form_error('role'); $level = array('name' => 'role', 'id' => 'role' ); 
        $options = array('admin'  => 'Administrator',
                  'adminar'    => 'Area Administrator',
                  'user'   => 'Registered User',
                  'Public' => 'Public');?> </td>
        <td> <?php echo form_dropdown('role', $options, array()); ?> </td>
    </tr>
    <tr>
        <td> <?php echo form_label('Linked to Area', 'areas'); echo form_error('areas'); $level = array('name' => 'areas', 'id' => 'areas' ); 
        $options = array('5124d0b806c5e53197c1564c'  => 'Farmall',
                  '5124d0b806c5e53197d1564c'    => 'Chartwell',
                  );
        $selected = array('5124d0b806c5e53197d1564c', '5124d0b806c5e53197c1564c');?> </td>
        <td> <?php echo form_dropdown('areas', $options, $selected); ?> </td>
    </tr>
    <tr>
        <td> <?php echo form_label('Linked to Groups', 'grp'); echo form_error('grp'); $level = array('name' => 'grp', 'id' => 'grp',  'maxlength'   => '100',
              'size'        => '50',
              'style'       => 'width: 150px',); 
        $options = array('cp1'  => 'CPF 1',
                  'cp2'    => 'CPF 2',
                  );
        $selected = array('cp2', 'cp2');?> </td>
        <td> <?php echo form_dropdown('grp', $options, $selected); ?> </td>
    </tr>
    <tr>
        <td> <?php echo form_label('Verified', 'verified'); echo form_error('verified'); $level = array('name' => 'verified', 'id' => 'verified', 'disabled' ); ?> </td>
        <td> <?php echo form_checkbox('Verified', 'verified', TRUE); ?> </td>
    </tr>
    <tr>
        <td> <?php echo form_label('Date on System', ''); echo form_error(''); $level = array('name' => 'dos', 'id' => 'dos', 'disabled' );?> </td>
        <td> <?php echo '12/09/1961 12:56'; ?> </td>
    </tr>
    <tr>
        <td colspan="2" align="right" > <?php echo form_submit('save', 'Save'); echo form_reset('reset', 'Reset');?>  
        
    </tr>
</table>    
<?=form_fieldset_close()?>
<?=form_close();?>

</div> <!--content-->
</div> <!--login-->